package org.thread.test06.ts.demo05.t01;

/**
 * 男孩
 * @author CSY
 * @date 2025 - 03 - 14
 */
public class BoyThread extends Thread {
    /**
     * 男孩要用的篮子
     */
    private Box box;
    private String name;

    public BoyThread() {
    }

    public BoyThread(Box box, String name) {
        this.box = box;
        this.name = name;
    }

    @Override
    public void run() {
        while (true) {
            Fruit fruit = new Fruit();
            box.put(name,fruit);
        }
    }
}
